﻿<%@ Page Title="" Language="C#" MasterPageFile="~/common/AfterLogin.master" AutoEventWireup="true" CodeFile="insurance_statement.aspx.cs" Inherits="product_insurance_user_insurance_statement" %>
<%------------------------ Jifen create 2013.06.05 -------------------------%>

<asp:Content ID="Content3" ContentPlaceHolderID="leftMenu" Runat="Server">
<ul>
    <li><a href="<%= Page.ResolveUrl("~/product/insurance/user/insurance_statement.aspx")%>">
        Plan Statement</a></li>
    <li><a href="<%= Page.ResolveUrl("~/product/insurance/user/insurance_certificate.aspx")%>">
        Plan Certificate</a></li>
    <li><a href="<%= Page.ResolveUrl("~/product/insurance/user/insurance_terminate.aspx")%>">
        Terminate / Renew</a></li>
    <li><a href="<%= Page.ResolveUrl("~/product/insurance/user/insurance_claim.aspx")%>">
        Claim Instructions</a></li>
    <li><a href="<%= Page.ResolveUrl("~/product/insurance/insurance_home.aspx")%>">Plan
        Details</a></li>
    <li><a href="<%= Page.ResolveUrl("~/product/insurance/user/insurance_apply_hospital.aspx")%>">
        Apply For Hospitalisation Plan</a></li>
    <li><a href="<%= Page.ResolveUrl("~/product/insurance/user/insurance_apply_accident.aspx")%>">
        Apply For Personal Accident Plan</a></li>
                  
    </ul>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="content" Runat="Server">

<h1 style="font-size: 2.0em; text-transform: none; font-weight: 900; font-family: Andalus;">Power Saver Insurance Statement</h1>
    <p>
        <asp:GridView ID="gvStatement" runat="server" 
            AutoGenerateColumns="False" BackColor="White" BorderColor="#DEDFDE" 
            BorderStyle="None" BorderWidth="1px" CellPadding="4" 
            DataSourceID="SqlDataSource1" ForeColor="Black" GridLines="Vertical" 
            onselectedindexchanged="gvStatement_SelectedIndexChanged">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="insuredID" HeaderText="Certificate No." 
                    SortExpression="insuredID" InsertVisible="False" ReadOnly="True" />
                <asp:BoundField DataField="category" HeaderText="Policy Type" 
                    SortExpression="category" />
                <asp:BoundField DataField="planType" HeaderText="Choice of Plan" 
                    SortExpression="planType" />
                <asp:BoundField DataField="startDate" HeaderText="Start Date" 
                    SortExpression="startDate" DataFormatString="{0:dd/MM/yyyy}" />
                <asp:BoundField DataField="endDate" HeaderText="End Date" 
                    SortExpression="endDate" DataFormatString="{0:dd/MM/yyyy}" />
                <asp:CommandField ButtonType="Button" SelectText="Make a Claim" 
                    ShowSelectButton="True" />
            </Columns>
            <FooterStyle BackColor="#CCCC99" />
            <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
            <RowStyle BackColor="#F7F7DE" />
            <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#FBFBF2" />
            <SortedAscendingHeaderStyle BackColor="#848384" />
            <SortedDescendingCellStyle BackColor="#EAEAD3" />
            <SortedDescendingHeaderStyle BackColor="#575357" />
        </asp:GridView>
        
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            
            
            SelectCommand="SELECT  INSURED.startDate,  INSURED.endDate, INSURED.insuredID, INSURED.planType, CASE  category   WHEN 'H' THEN 'Hospitalisation'  WHEN 'A'  THEN 'Accident'  END As  category   FROM INSURANCE INNER JOIN INSURED ON INSURANCE.accountNo = INSURED.accountNo WHERE INSURED.policyStatus = 'ACTIVE' and custID = @custID
  ">
            <SelectParameters>
                <asp:SessionParameter Name="custID" SessionField="userId" />
            </SelectParameters>
        </asp:SqlDataSource>
        
    </p>
    <p>
        &nbsp;</p>
    
       <h1 style="font-size: 2.0em; text-transform: none; font-weight: 900; font-family: Andalus;">Claim Statement</h1> 
    <p>
        <asp:GridView ID="gvClaimStatement" runat="server" 
            DataSourceID="SqlDataSource_claimStatement" AutoGenerateColumns="False" 
            BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" 
            CellPadding="4" ForeColor="Black" GridLines="Vertical">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="insuredID" HeaderText="Certificate No." 
                    SortExpression="insuredID" />
                <asp:BoundField DataField="InsuredName" HeaderText="Insured Name" 
                    ReadOnly="True" SortExpression="InsuredName" />
                <asp:BoundField DataField="claimDescription" HeaderText="ClaimDescription" 
                    SortExpression="claimDescription" />
                <asp:BoundField DataField="claimAmount" HeaderText="Amount Claimed" 
                    SortExpression="claimAmount" />
                <asp:BoundField DataField="claimStatus" HeaderText="Claim Status" 
                    SortExpression="claimStatus" />
                <asp:BoundField DataField="handledDate" HeaderText="Handled Date" 
                    SortExpression="handledDate" />
                <asp:BoundField DataField="StaffName" HeaderText="Staff Name" ReadOnly="True" 
                    SortExpression="StaffName" />
            </Columns>
            <FooterStyle BackColor="#CCCC99" />
            <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
            <RowStyle BackColor="#F7F7DE" />
            <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#FBFBF2" />
            <SortedAscendingHeaderStyle BackColor="#848384" />
            <SortedDescendingCellStyle BackColor="#EAEAD3" />
            <SortedDescendingHeaderStyle BackColor="#575357" />
        </asp:GridView>

        <asp:SqlDataSource ID="SqlDataSource_claimStatement" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT CLAIM.insuredID, INSURED.fName+INSURED.lName InsuredName, CLAIM.claimDescription, CLAIM.claimAmount, CLAIM.claimStatus, CONVERT(NVARCHAR(20),CLAIM.handledDate,103) AS handledDate, STAFF.staffFName+STAFF.staffLName StaffName
FROM            CLAIM INNER JOIN
                         STAFF ON CLAIM.staffID = STAFF.staffID inner JOIN
                         INSURED on  INSURED.insuredID=CLAIM.insuredID INNER JOIN
                         INSURANCE on INSURANCE.accountNo = INSURED.accountNo
WHERE            INSURANCE.custID = @custID">
            <SelectParameters>
                <asp:SessionParameter Name="custID" SessionField="userId" />
            </SelectParameters>
        </asp:SqlDataSource>

    </p>
   
    <p>
        &nbsp;</p>

    

</asp:Content>

